package com.smarty.net;

import javax.net.ssl.SSLContext;
import java.io.FileOutputStream;
import java.security.*;

public class KeyS {
    public static void main(String[] args) throws Exception {
        KeyStore keyStore= KeyStore.getInstance(KeyStore.getDefaultType());
        keyStore.load(null,null);
        SSLContext sslContext = SSLContext.getDefault();
        KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("RSA");
        keyPairGenerator.initialize(2048);
        KeyPair keyPair = keyPairGenerator.generateKeyPair();
        PublicKey publicKey = keyPair.getPublic();
        PrivateKey privateKey = keyPair.getPrivate();


        FileOutputStream fileOutputStream = new FileOutputStream("test.jks");
        keyStore.store(fileOutputStream,"123".toCharArray());
    }
}
